<style>
.box-header {
    color: #444;
    display: block;
    padding: 2px;
    position: relative;
}

.box-body {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 1px;
    border-bottom-left-radius: 1px;
    padding: 2px;
}

/*.glyphicon {
    font-size: 28px;
}*/

.text-grey {
  color: grey;
}

.layout-padding,
.layout-padding-gt-sm,
.layout-padding-gt-sm > *,
.layout-padding-md,
.layout-padding-md > *,
.layout-padding > *,
.layout-padding > .flex,
.layout-padding > .flex-gt-sm,
.layout-padding > .flex-md {
    padding: 2px;
}

.select-div {
    float: left;
}
</style>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header" style="margin-top:1px;">
                    <div flex layout="column" layout-gt-md="row" layout-padding>
                        <!--<md-card flex >-->
                        <div title="工程名称" style="width: 30%;">
                            <input ng-disabled="isRun" type="text" uib-popover="1.请输入工程名称. " popover-trigger="mouseenter" ng-model="info.selectProject" placeholder="Select Project" uib-typeahead="project for project in info.projectList | filter:$viewValue" typeahead-template-url="projectTemplate.html" class="form-control" typeahead-show-hint="true" typeahead-min-length="0" typeahead-on-select="onChange();" typeahead-select-on-blur="true">
                        </div>
                        <div title="工程名称" align="center" style="width: 5%;">
                            <!-- <input ng-disabled="isRun" style="margin-left: 30px;" type="checkbox" ng-click="filterConfig();" ng-model="info.filterConfig" ng-true-value="true" na-false-value="false" class="ng-pristine ng-untouched ng-valid" disabled="disabled" aria-invalid="false">
                            <button ng-disabled="isRun" style="margin-left: 12px;" class="btn btn-info" title="更新svn文件" ng-click="downLoadFile();" disabled="disabled"><img src="/beetle/image/icon_cloud-download_alt.png" style="width: 10px;"></button> -->
                            <i ng-disabled="isRun" ng-class="{false: 'glyphicon glyphicon-eye-open', true: 'glyphicon glyphicon-eye-close'}[info.filterConfig]" ng-click="isRun || filterConfig();" uib-popover="显示/过滤 非规范配置文件" popover-trigger="mouseenter" style="font-size: 23px"/>&nbsp;&nbsp;
                        </div>
                        <div title="同步工程代码与配置文件" align="left" style="width: 5%;">
                            <i ng-class="{false: 'glyphicon glyphicon-refresh', true: 'glyphicon glyphicon-refresh text-grey'}[isRun]" ng-click="isRun || downLoadFile();" uib-popover="同步工程代码与配置文件" popover-trigger="mouseenter" style="font-size: 23px" />
                        </div>
                        <div title="工程名称" style="width: 30%;">
                            <span ng-show="isCheckIng" style="color: red;padding-left: 10%;">正在下载代码和配置文件,请稍后......</span>
                        </div>
                        <div title="工程名称" style="width: 20%;">
                            <span ng-if="errorDesc != ''" style="color: red;padding-left: 10%;">{{errorDesc}}</span>
                        </div>
                    </div>
                </div>
                <div class="box-body" style="margin-top:1px;">
                    <p>
                        <div flex layout="column" layout-gt-md="row" layout-padding>
                            <!--<md-card flex >-->
                            <div title="{{left.path}}" style="width: 50%;">
                                <md-card-content>
                                    <div style="line-height: 40px;">
                                        <input ng-disabled="isRun" type="text" ng-model="info.selectFileObj" placeholder="Select file name" uib-typeahead="file as file.key for file in info.fileList | filter:$viewValue" typeahead-template-url="projectTemplate.html" class="form-control" typeahead-show-hint="true" typeahead-min-length="0" typeahead-on-select="onChange();" typeahead-select-on-blur="true" uib-popover="2. 输入代码目录下的配置文件名, 在下方显示其内容. " popover-trigger="mouseenter">
                                    </div>
                                    <div style="line-height: 25px;">
                                        <img src="/beetle/image/release_not_start.png" style="width: 20px;">
                                    </div>
                                    <!--<h5>{{left.path}}</h5>-->
                                    <pre ng-show="left.exist == '0'" class="textdiff" processing-diff left-obj="left.text" right-obj="left.text"></pre>
                                    <span ng-show="left.exist == '1'" style="color: red;">无</span>
                                </md-card-content>
                            </div>
                            <!--</md-card>-->
                            <!--<md-card flex >-->
                            <!-- 当前文件不存在,只可新增 -->
                            <div title="{{right.showPath}}" style="width: 50%;">
                                <md-card-content>
                                    <div style="line-height: 40px;">
                                        <input  ng-disabled="isRun" type="text" ng-model="info.selectEnv" placeholder="Select evn name" uib-typeahead="evn for evn in info.envList | filter:$viewValue" typeahead-template-url="projectTemplate.html" class="form-control" typeahead-show-hint="true" typeahead-min-length="0" typeahead-on-select="onChange();" typeahead-select-on-blur="true" uib-popover="3. 选好环境后, 下方将显示该环境下的同名配置文件内容" popover-trigger="mouseenter">
                                    </div>
                                    <div ng-if="isRun" style="line-height: 25px;">
                                        <img src="/beetle/image/icon_add_unable.png" style="width: 20px;">
                                        <img src="/beetle/image/icon_edit_unable.png" style="width: 20px;">
                                        <img src="/beetle/image/icon_back_unable.png" style="width: 20px;">
                                        <img src="/beetle/image/icon_save_unable.png" style="width: 20px;">
                                    </div>
                                    <div ng-if="!isRun && right.exist == '1'" style="line-height: 25px;">
                                        <img src="/beetle/image/icon_add_able.png" ng-click="addConfig();" style="cursor: pointer;width: 20px;">
                                        <img src="/beetle/image/icon_edit_unable.png" style="width: 20px;">
                                        <img src="/beetle/image/icon_back_unable.png" style="width: 20px;">
                                        <img src="/beetle/image/icon_save_unable.png" style="width: 20px;">
                                    </div>
                                    <!-- 当前文件已存在,新增按钮不可点,其他可点 -->
                                    <div ng-if="!isRun && right.exist == '0'">
                                        <img src="/beetle/image/icon_add_unable.png" style="width: 20px;">
                                        <img src="/beetle/image/icon_edit_able.png" ng-if="!edit" ng-click="editConfig();" style="cursor: pointer;width: 20px;">
                                        <img src="/beetle/image/icon_edit_ing.png" ng-if="edit" ng-click="editConfig();" style="cursor: pointer;width: 20px;">
                                        <img src="/beetle/image/icon_back_able.png" ng-if="baseText != right.text" ng-click="rollBack();" style="cursor: pointer;width: 20px;">
                                        <img src="/beetle/image/icon_back_unable.png" ng-if="baseText == right.text" style="width: 20px;">
                                        <img src="/beetle/image/icon_save_able.png" ng-if="baseText != right.text" ng-click="saveConfig();" style="cursor: pointer;width: 20px;">
                                        <img src="/beetle/image/icon_save_unable.png" ng-if="baseText == right.text" style="width: 20px;">
                                    </div>
                                    <!--<h5>{{right.showPath}}</h5>-->
                                    <pre ng-show="right.exist == '0' && !edit" class="textdiff" processing-diff left-obj="left.text" right-obj="right.text"></pre>
                                    <textarea wrap="off" style="overflow-y:scroll;" ng-show="right.exist == '0' && edit" ng-model="right.text" cols="75" rows="30"></textarea>
                                    <span ng-show="right.exist == '1'" style="color: red;">该环境下没有左边这个配置文件,可以选择上方的'+' 图标创建它,编辑后点击保存后该文件会上传配置中心.</span>
                                </md-card-content>
                            </div>
                            <!--</md-card>-->
                        </div>
                    </p>
                </div>
            </div>
        </div>
    </div>
</section>
<script type="text/ng-template" id="projectTemplate.html">
    <a>
        <span ng-bind-html="match.label | uibTypeaheadHighlight:query"></span>
    </a>
</script>
